package com.king.armips.android.configs;

import android.content.Context;
import android.content.SharedPreferences;

import androidx.annotation.Nullable;

public class AppConfigs {

    private static SharedPreferences sp;

    public static void init(Context context){
        sp = context.getSharedPreferences("app_configs", Context.MODE_PRIVATE);
    }

    public static String getAssemblyParameters(){
        return sp.getString("AssemblyParameters", "");
    }

    public static void setAssemblyParameters(String value){
        sp.edit().putString("AssemblyParameters", value).apply();
    }

    @Nullable
    public static String getLastOpenedFilePath(){
        return sp.getString("LastOpenedFilePath", null);
    }

    public static void setLastOpenedFilePath(String value){
        sp.edit().putString("LastOpenedFilePath", value).apply();
    }

    public static String getTestCode(){
        return ".gba\n" +
                ".create \"" +
                "test.bin" +
                "\",0\n" +
                ".thumb\n\n" +
                "mov r0, #0xAA\n\n" +
                ".pool\n" +
                ".close\n";
    }


}
